package tcp.filetransfer;

import handlers.FileHandler;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class FileTransferManager extends Thread{

	private static final int NUM_OF_THREADS = 10 ;
	private ExecutorService threadPool;
	private FileHandler handler;
	private DownloadManager dwnLoadManager;
	private UploadManager upLoadManager;
	
	public FileTransferManager(int uploadPort, int downloadPort) {
		this.threadPool = Executors.newCachedThreadPool();
		this.upLoadManager = new UploadManager(this, uploadPort);
		this.dwnLoadManager = new DownloadManager(this, downloadPort);
	}
	public FileTransferManager(FileHandler handler){
		this.threadPool = Executors.newCachedThreadPool();
		this.handler = handler;
	}
	public ExecutorService getThreadPool(){
		return this.threadPool;
	}
	public void setFileHandler(FileHandler fileHandler){
		this.handler = fileHandler;
	}
	public FileHandler getFileHandler(){
		return this.handler;
	}
	
}
